<div class="d-flex align-items-center justify-content-between">
  <div class="d-flex align-items-center justify-content-start">
    <span class="font-weight-bold text-info"
      >{{ 'enum.OUT_OF' | translate }}&nbsp; {{ rowData.length }}</span
    >
  </div>
  <div class="d-flex align-items-center justify-content-end">
    <button
      (click)="openDialog()"
      *ngIf="isRegistryScanAuthorized"
      class="d-flex align-items-center justify-content-start mr-3"
      id="registries-add-dialog"
      mat-stroked-button>
      <i class="eos-icons mr-2">add_circle</i>{{ 'role.ADD' | translate }}
    </button>
    <mat-form-field appearance="standard">
      <mat-label>{{ 'enum.FILTER' | translate }}</mat-label>
      <input [formControl]="filter" matInput [attr.maxlength]="'general.FILTER_MAX_LEN' | translate"/>
    </mat-form-field>
  </div>
</div>
<ag-grid-angular
  (window:resize)="onResize()"
  [gridOptions]="gridOptions"
  [ngStyle]="{ height: gridHeight + 'px' }"
  class="ag-theme-alpine"
  style="width: 100%">
</ag-grid-angular>
<div class="d-flex align-items-center justify-content-end mt-2">
  <app-loading-button
    (btnClick)="startScan()"
    [appearance]="'mat-stroked-button'"
    [buttonClasses]="'mr-2'"
    *ngIf="isRegistryScanAuthorized && !(isFedRegistry && (isRemote || !isFedAdmin))"
    [disabled]="
      (gridApi && !gridApi.getSelectedNodes().length) ||
      (gridApi &&
        gridApi.getSelectedNodes().length &&
        gridApi.getSelectedNodes()[0].data.status === 'scanning') ||
      !!(startingScan$ | async)
    "
    [id]="'registries-start-scan-button'"
    [loading]="!!(startingScan$ | async)"
    [text]="'registry.START_SCAN' | translate"
    [type]="'button'">
  </app-loading-button>
  <app-loading-button
    (btnClick)="stopScan()"
    [appearance]="'mat-stroked-button'"
    *ngIf="isRegistryScanAuthorized && !(isFedRegistry && (isRemote || !isFedAdmin))"
    [disabled]="
      (gridApi && !gridApi.getSelectedNodes().length) ||
      (gridApi &&
        gridApi.getSelectedNodes().length &&
        gridApi.getSelectedNodes()[0].data.status === 'idle') ||
      !!(stoppingScan$ | async)
    "
    [id]="'registries-stop-scan-button'"
    [loading]="!!(stoppingScan$ | async)"
    [text]="'registry.STOP_SCAN' | translate"
    [type]="'button'">
  </app-loading-button>
</div>
